import { Select, Space } from "antd"
import { useTranslation } from "react-i18next"


function index() {
  // eslint-disable-next-line react-hooks/rules-of-hooks
  const {t,i18n}=useTranslation()
  const handleChange=(val:any)=>{
    i18n.changeLanguage(val)
  }
  return (
    <div>
      <Space wrap>
        <Select
          defaultValue={'zh'}
          style={{ width: 120 }}
          onChange={handleChange}
          options={[
            { value: 'zh', label: '中文' },
            { value: 'en', label: 'English' }
          ]}
        />
      </Space>
      {t('Welcome to React')} 
    </div>
  )                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               
}

export default index
